package com.muyu.system.service.impl;

import com.muyu.common.core.utils.DateUtils;
import com.muyu.system.domain.DanmoShoppingFootprint;
import com.muyu.system.mapper.DanmoShoppingFootprintMapper;
import com.muyu.system.service.IDanmoShoppingFootprintService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 商品足迹Service业务层处理
 *
 * @author yangle
 * @date 2024-09-29
 */
@Service
public class DanmoShoppingFootprintServiceImpl implements IDanmoShoppingFootprintService
{
    @Autowired
    private DanmoShoppingFootprintMapper danmoShoppingFootprintMapper;

    /**
     * 查询商品足迹
     *
     * @param id 商品足迹主键
     * @return 商品足迹
     */
    @Override
    public DanmoShoppingFootprint selectDanmoShoppingFootprintById(Long id)
    {
        return danmoShoppingFootprintMapper.selectDanmoShoppingFootprintById(id);
    }

    /**
     * 查询商品足迹列表
     *
     * @param danmoShoppingFootprint 商品足迹
     * @return 商品足迹
     */
    @Override
    public List<DanmoShoppingFootprint> selectDanmoShoppingFootprintList(DanmoShoppingFootprint danmoShoppingFootprint)
    {
        return danmoShoppingFootprintMapper.selectDanmoShoppingFootprintList(danmoShoppingFootprint);
    }

    /**
     * 新增商品足迹
     *
     * @param danmoShoppingFootprint 商品足迹
     * @return 结果
     */
    @Override
    public int insertDanmoShoppingFootprint(DanmoShoppingFootprint danmoShoppingFootprint)
    {
        danmoShoppingFootprint.setCreateTime(DateUtils.getNowDate());
        return danmoShoppingFootprintMapper.insertDanmoShoppingFootprint(danmoShoppingFootprint);
    }

    /**
     * 修改商品足迹
     *
     * @param danmoShoppingFootprint 商品足迹
     * @return 结果
     */
    @Override
    public int updateDanmoShoppingFootprint(DanmoShoppingFootprint danmoShoppingFootprint)
    {
        danmoShoppingFootprint.setUpdateTime(DateUtils.getNowDate());
        return danmoShoppingFootprintMapper.updateDanmoShoppingFootprint(danmoShoppingFootprint);
    }

    /**
     * 批量删除商品足迹
     *
     * @param ids 需要删除的商品足迹主键
     * @return 结果
     */
    @Override
    public int deleteDanmoShoppingFootprintByIds(Long[] ids)
    {
        return danmoShoppingFootprintMapper.deleteDanmoShoppingFootprintByIds(ids);
    }

    /**
     * 删除商品足迹信息
     *
     * @param id 商品足迹主键
     * @return 结果
     */
    @Override
    public int deleteDanmoShoppingFootprintById(Long id)
    {
        return danmoShoppingFootprintMapper.deleteDanmoShoppingFootprintById(id);
    }
}
